package demo1;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-12-11
 * Time: 16:40
 */
public class Test1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        try {
            Scanner scanner1 = new Scanner(System.in);
            int a = scanner.nextInt();
            int ret = 10/a;
            System.out.println("ret 的值为："+ret);
        }catch (NullPointerException e){
            System.out.println("捕捉了空指针异常!");
        }catch (ArithmeticException e){
            System.out.println("捕获了：ArithmeticException");
        }
        finally {
            scanner.close();
            System.out.println("finall被执行了！");
        }
    }
}
